package banking;
import banking.*;
public class TestBanking{      //TestBanking类主要用于测试银行系统
    public static void main(String[]args){
        Customer customer;     //定义Customer类型变量customer，存放存款人员相关的数据
        Account account;     //定义Account类型变量account，存放余额相关的数据
        //Create an account that can has a 500.00 balance.
        System.out.println("Creating the customer Jane Smith.");
        customer=new Customer("Jane","Smith",20);     //创建对象，即存款人员，设置三个实参为人员的信息
        System.out.println("Creating her account with a 500.00 balance.");
        customer.setAccount(new Account(500.00));     //调用setAccount方法，实参为新创建的对象：设置实参余额为500.00
        account=customer.getAccount();     //调用getAccount方法，获取余额，赋值给变量account
        //Perform some account transactions
        System.out.println("Withdraw 150.00:"+account.withdraw(150.00));    //调用withdraw方法判断取款是否成功并输出，成功则计算余额
        System.out.println("Deposit 22.50:"+account.deposit(22.50));    //调用deposit方法计算余额，并输出true表示存款成功
        System.out.println("Withdraw 47.62:"+account.withdraw(47.62));      //调用withdraw方法判断取款是否成功并输出，成功则计算余额
        System.out.println("Withdraw 400.00:"+account.withdraw(400.00));    //调用withdraw方法判断取款是否成功并输出，成功则计算余额
        customer.setAge(30);    //调用setAge方法，设置实参为30，作为修改后的年龄
        //Print out the final account balance 输出存款人员信息
        System.out.println("Customer["+customer.getLastName()
                +","+customer.getFirstName()
                +","+customer.getAge()
                +"]has a balance of "+account.getBalance());
    }
}